<template>
	<view>
		<u-collapse :value="['1']" ref='coll'>
			<u-collapse-item name="1" title="室内照片" icon="https://project.gxrunxiang.com/cdn/image.png">
				<u-album :urls="imagesurls1"></u-album>
			</u-collapse-item>
			<u-collapse-item name="1" title="室外照片" icon="https://project.gxrunxiang.com/cdn/image.png">
				<u-album :urls="imagesurls2"></u-album>
			</u-collapse-item>
			<u-collapse-item name="1" title="设备照片" icon="https://project.gxrunxiang.com/cdn/image.png">
				<u-album :urls="imagesurls3"></u-album>
			</u-collapse-item>
			<u-collapse-item name="1" title="图纸" icon="https://project.gxrunxiang.com/cdn/image.png">
				<u-album :urls="imagesurls4"></u-album>
			</u-collapse-item>
			<u-collapse-item name="1" title="其它材料" icon="https://project.gxrunxiang.com/cdn/image.png">
				<u-album :urls="imagesurls5"></u-album>
			</u-collapse-item>
			<u-collapse-item name="1" title="节点视频" icon="https://project.gxrunxiang.com/cdn/image.png">
				<u-list>
					<u-list-item v-for="(item,index) in list4" :key="index">
						<video :src="item"></video>
					</u-list-item>
				</u-list>
			</u-collapse-item>
		</u-collapse>
	</view>
</template>
<script>
	import {
		baseUrl
	} from '@/common/config.js'
	import {
		mapGetters
	} from 'vuex'
	import {
		getfilebyoutid
	} from '@/common/api.js'
	const {
		http
	} = uni.$u
	export default {
		data() {
			return {
				imagesurls1: [],
				imagesurls2: [],
				imagesurls3: [],
				imagesurls4: [],
				imagesurls5: [],
				list4: [],
				Id: "",
				src: ""
			}
		},
		onLoad(option) {
			this.user = JSON.parse(uni.getStorageSync("$userinfo"))
			this.Id = option.Id
			this.getlist()
		},
		methods: {
			getlist() {
				this.imagesurls1 = []
				this.imagesurls2 = []
				this.imagesurls3 = []
				this.imagesurls4 = []
				this.list4 = []
				getfilebyoutid(this.Id).then(res => {
					for (var i = 0; i < res.length; i++) {
						if (res[i].MyType == '室内照片') {
							this.imagesurls1.push(`${baseUrl}/SysFile/download?id=${res[i].Id}`)
						}
						if (res[i].MyType == '室外照片') {
							this.imagesurls2.push(`${baseUrl}/SysFile/download?id=${res[i].Id}`)
						}
						if (res[i].MyType == '设备照片') {
							this.imagesurls3.push(`${baseUrl}/SysFile/download?id=${res[i].Id}`)
						}
						if (res[i].MyType == '图纸') {
							this.imagesurls4.push(`${baseUrl}/SysFile/download?id=${res[i].Id}`)
						}
						if (res[i].MyType == '其它材料') {
							this.imagesurls5.push(`${baseUrl}/SysFile/download?id=${res[i].Id}`)
						}
						if (res[i].MyType == '节点视频') {
							this.list4.push(`${baseUrl}/SysFile/download?id=${res[i].Id}`)
						}
					}
				setTimeout(() => {
						// console.log(this.$refs.coll)
						this.$refs.coll.init()

					},
					1000)
			})
	},
	}
	}
</script>